package tools

import (
	"bytes"
	"os/exec"
)

func RunShellCmd(name string, arg ...string) (error, string, string) {

	cmd := exec.Command(name, arg...)

	var out bytes.Buffer
	var stderr bytes.Buffer

	cmd.Stdout = &out
	cmd.Stderr = &stderr

	//启动命令并等待其完成
	err := cmd.Run()

	return err, stderr.String(), out.String()
}
